package com.c.ctgproject.ui.files

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.c.ctgproject.base.BaseViewModel
import com.c.ctgproject.http.ApiMethods
import com.c.ctgproject.utils.awaitSync
import com.c.ctgproject.utils.launch

class FileManagerViewModel : BaseViewModel() {
    private val mResult = MutableLiveData<String>()
    val result: LiveData<String> get() = mResult

    fun getList(search: String, page: Int) {
        launch {
            mResult.value = ApiMethods.retrofit.fileManagerList(search, page, 20).awaitSync()
        }
    }


    private val mCommonResult = MutableLiveData<String>()
    val commonResult: LiveData<String> get() = mCommonResult

    //回收录入
    fun recycle(search: String, page: Int) {
        launch {
//            mResult.value = ApiMethods.retrofit.fileManagerList(search, page, 20).awaitSync()
        }
    }
}